using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using Husb.Data;
using Husb.Util;
using CentralOffice.Admin.Data;
using CentralOffice.Admin.DataAccess;
using AttendHolidayTable = CentralOffice.Admin.Data.AttendDataSet.Attend_HolidayDataTable;
using AttendHolidayRow = CentralOffice.Admin.Data.AttendDataSet.Attend_HolidayRow;

namespace CentralOffice.Admin.DataAccess
{
    public class AttendHolidayAdapter : DataAccessAdapter<Admin.Data.AttendDataSet, AttendHolidayTable, AttendHolidayRow>
    {
        public AttendHolidayAdapter()
        {
            this.TableName = "Attend_Holiday";
            InsertStoredProc = "Admin.AttendHoliday_InsertAttendHoliday";
            DeleteStoredProc = "Admin.AttendHoliday_DeleteAttendHoliday";

            GetAllStoredProc = "Admin.AttendHoliday_SelectAttendHolidayAll";
            UpdateStoredProc = "Admin.AttendHoliday_UpdateAttendHoliday";
            FindStoredProc = "Admin.AttendHoliday_SelectAttendHolidayDynamic";
            GetByIdStoredProc = "Admin.AttendHoliday_SelectAttendHoliday";


            GetPagedStoredProc = "Admin.AttendHoliday_SelectAttendHolidayPaged";
            GetRowCountStoredProc = "Admin.AttendHoliday_SelectAttendHolidayRowCount";
        }

        protected override void PopulateInsertParameters(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbCommand cmd)
        {
            db.AddInParameter(cmd, "HolidayName", DbType.String, "HolidayName", System.Data.DataRowVersion.Current);
            db.AddInParameter(cmd, "BeginDate", DbType.DateTime, "BeginDate", System.Data.DataRowVersion.Current);
            db.AddInParameter(cmd, "EndDate", DbType.DateTime, "EndDate", System.Data.DataRowVersion.Current);
        }

        protected override void PopulateUpdateParameters(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Int32, "HolidayId", System.Data.DataRowVersion.Current);
            PopulateInsertParameters(db, cmd);
        }
    }
}
